import { createRouter ,createWebHashHistory, createWebHistory} from 'vue-router'

import Layout from '../views/Main.vue'
import Login from '../views/login/index.vue'

import Menu from '../views/auth/menu/index.vue'
import Resorce from '../views/auth/resource/index.vue'
import Role from '../views/auth/role/index.vue'
import User from '../views/auth/user/index.vue'

import Grouplist from '../views/group/groupList/index.vue'
import Addgroup from '../views/group/addGroup/index.vue'
import WorkerList from '../views/group/workerList/index.vue'

import Orderlist from '../views/order/orderList/index.vue'
import Addorder from '../views/order/addOrder/index.vue'

import ProductList from '../views/product/productlist/index.vue'
import Addproduct from '../views/product/addProduct/index.vue'
import ProductClassify from '../views/product/productclassify/index.vue'
import AddClassify from '../views/product/addClassify/index.vue'

import Shoplist from '../views/shop/shopList/index.vue'
import Addshop from '../views/shop/addShop/index.vue'

// import Worklist from '../views/worker/workerList/index.vue'
// import Addworker from '../views/worker/addWorker/index.vue'

import Test from '../components/test.vue'

const routes = [
    { 
      path: '/',
      component: Layout,
      name: 'main',
      children: [
        {
          path: 'product',
          meta: { id: 'a', name: '货品管理', icon: 'ShoppingCartFull', path: '/product', describe: '' },
          children: [
            {
              path: 'productlist',
              meta: { id: 'b', name: '货品列表', icon: 'List', path: '/product/productlist', describe: '' },
              component: ProductList
            },
            {
              path: 'addProduct',
              meta: { id: 'c', name: '添加货品', icon: 'FolderAdd', path: '/product/addProduct', describe: '' },
              component: Addproduct
            },
            {
              path: 'productclassify',
              meta: { id: 'd', name: '货品分类', icon: 'Paperclip', path: '/product/productclassify', describe: '' },
              component: ProductClassify
            },
            {
              path: 'addClassify',
              meta: { id: 'e', name: '添加分类', icon: 'List', path: '/product/addClassify', describe: '' },
              component: AddClassify
            },
          ]
        },
        {
          path: 'shop',
          meta: { id: 'f', name: '店铺管理', icon: 'HomeFilled', path: '/shop', describe: '' },
          children: [
            {
              path:'shopList',
              meta:{id: 'g', name: '店铺列表', icon: 'List', path: '/shop/shopList', describe: ''},
              component:Shoplist
            },
            {
              path:'addShop',
              meta:{id: 'h', name: '添加店铺', icon: 'FolderAdd', path: '/shop/addShop', describe: ''},
              component:Addshop
            },
          ]
        },
        {
          path: 'group',
          meta: { id: 'i', name: '小组管理', icon: 'Van', path: '/group', describe: '' },
          children:[
            {
              path:'groupList',
              meta:{id: 'j', name: '小组列表', icon: 'List', path: '/group/groupList', describe: ''},
              component:Grouplist
            },
            {
              path:'workerList',
              meta:{id: 'k', name: '工人列表', icon: 'List', path: '/group/workerList', describe: ''},
              component:WorkerList
          },
            {
              path:'addGroup',
              meta:{id: 'l', name: '添加小组', icon: 'DocumentAdd', path: '/group/addGroup', describe: ''},
              component:Addgroup
            },
        ]
      },
    //   {
    //     path: 'worker',
    //     meta: { id: 'l', name: '工人管理', icon: 'Van', path: '/worker', describe: '' },
    //     children:[
    //       {
    //         path:'workerList',
    //         meta:{id: 'm', name: '工人列表', icon: 'List', path: '/worker/workerList', describe: ''},
    //         component:Worklist
    //       },
    //       {
    //         path:'addWorker',
    //         meta:{id: 'n', name: '添加工人', icon: 'DocumentAdd', path: '/worker/addWorker', describe: ''},
    //         component:Addworker
    //       },
    //   ]
    // },
        {
            path: 'order',
            meta: { id: 'o', name: '订单管理', icon: 'Edit',path: '/order' },
            children:[
              {
                path:'orderList',
                meta:{id: 'p', name: '订单列表', icon: 'List', path: '/order/orderList', describe: ''},
                component:Orderlist
              },
              {
                path:'addOrder',
                meta:{id: 'q', name: '添加订单', icon: 'DocumentAdd', path: '/order/addOrder', describe: ''},
                component:Addorder
              }
            ]
        },
        {
            path: 'auth',
            meta: { id: 'r' ,name: '权限管理', icon: 'Key' },
            children: [
            {
                path: 'role',
                alias: ['role'],
                meta: { id: 's', name: '角色列表', icon: 'Avatar', path: '/auth/role', describe: '' },
                component: Role
            },
            {
                path: 'user',
                meta: { id: 't', name: '用户列表', icon: 'UserFilled', path: '/auth/user', describe: '' },
                component: User
            },
            {
                path: 'menu',
                meta: { id: 'u', name: '菜单管理', icon: 'Menu', path: '/auth/menu', describe: '' },
                component: Menu
              },
              {
                path: 'resource',
                meta: { id: 'v', name: '资源列表', icon: 'UploadFilled', path: '/auth/resource', describe: '' },
                component: Resorce
              }
          ]
        },
       
      ]
    },
    {
      path: '/test',
      component: Test
  },
    {
        path: '/login',
        component: Login
    }
  ]

const router=createRouter({
    //      路由数据
    routes,
    //路由匹配模式
    history:createWebHistory(),

})
export default router